//====================================================================================
//	SHISM DEMO SOURCE (c) acid.zone51
//====================================================================================
//
//	name	: c:\myproject\schism\imagequad.h
//	created	: 5:7:2001   21:14
//	desc	: class representing quad used for displaing sprites (quat is created
//			  from two triangles)
//
//====================================================================================		
//		
//	version	: 
//
//		+ v0.7 initial tested version
//
//====================================================================================
#if !defined(AFX_IMAGEQUAD_H__A29D98E3_708B_11D5_AD0F_607057C10000__INCLUDED_)
#define AFX_IMAGEQUAD_H__A29D98E3_708B_11D5_AD0F_607057C10000__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define	IQ_USEDEFAULT			0xffffffff

class CImageQuad  
{
private:

	PDIRECT3DVERTEXBUFFER8		m_pvbQuad;	

public:
	CImageQuad::CImageQuad( PDIRECT3DDEVICE8 pDevice, DWORD x0 = IQ_USEDEFAULT, DWORD y0 = IQ_USEDEFAULT, DWORD x1 = IQ_USEDEFAULT, DWORD y1 = IQ_USEDEFAULT );
	~CImageQuad();
	
	BOOL Resize( LPRECT pRect );
	BOOL Resize( FLOAT x0, FLOAT y0, FLOAT x1, FLOAT y1 );

	BOOL SetZ( FLOAT fZ );
	
	BOOL SetColor( DWORD dwColor );
	BOOL SetAlpha( DWORD dwAlpha );

	BOOL SetARGB( DWORD dwARGB );

	BOOL Lock( LPBYTE* ppVertices );
	BOOL Unlock();

	// this function sets streams sources, indices and call DrawPrimitive function
	// nothing more, its mean that all apropiate RS and/or TSS and/or textures should be
	// set before calling it
	BOOL Render( PDIRECT3DDEVICE8 pDevice );
};

#endif // !defined(AFX_IMAGEQUAD_H__A29D98E3_708B_11D5_AD0F_607057C10000__INCLUDED_)
